--------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\yiranli\Dropbox\A&A\Stata14\03_analysis.log
  log type:  text
 opened on:  11 Jan 2023, 10:44:27

. use 03_externality.dta

. 
. *************Table 7=====================
. 
. xi: reg baidu_ln rain_ln i.type i.year i.pro_id
i.type            _Itype_1-4          (naturally coded; _Itype_1 omitted)
i.year            _Iyear_2009-2014    (naturally coded; _Iyear_2009 omitted)
i.pro_id          _Ipro_id_1-25       (naturally coded; _Ipro_id_1 omitted)

      Source |       SS           df       MS      Number of obs   =       187
-------------+----------------------------------   F(33, 153)      =      2.48
       Model |  295.451908        33  8.95308812   Prob > F        =    0.0001
    Residual |   553.20951       153  3.61574843   R-squared       =    0.3481
-------------+----------------------------------   Adj R-squared   =    0.2075
       Total |  848.661418       186   4.5626958   Root MSE        =    1.9015

------------------------------------------------------------------------------
    baidu_ln |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     rain_ln |   .1617074   .0755559     2.14   0.034     .0124399    .3109749
    _Itype_2 |  -1.091619   .6148162    -1.78   0.078    -2.306244    .1230057
    _Itype_3 |  -.1242161   .5692487    -0.22   0.828    -1.248818    1.000386
    _Itype_4 |  -.9629784   .4869254    -1.98   0.050    -1.924943   -.0010133
 _Iyear_2010 |  -1.947146   .6955982    -2.80   0.006    -3.321363   -.5729295
 _Iyear_2011 |  -1.349691   .6479255    -2.08   0.039    -2.629726   -.0696556
 _Iyear_2012 |  -.6119847   .6418049    -0.95   0.342    -1.879928    .6559589
 _Iyear_2013 |  -1.237237   .6785117    -1.82   0.070    -2.577698    .1032243
 _Iyear_2014 |  -1.555403   .6262472    -2.48   0.014    -2.792611   -.3181948
  _Ipro_id_2 |    .806696   .9053804     0.89   0.374    -.9819647    2.595357
  _Ipro_id_3 |   1.203392   1.172624     1.03   0.306    -1.113232    3.520017
  _Ipro_id_4 |   2.157877    1.31861     1.64   0.104    -.4471557    4.762909
  _Ipro_id_5 |   1.421463   .8396183     1.69   0.092    -.2372792    3.080204
  _Ipro_id_6 |    .679205   .9847057     0.69   0.491     -1.26617     2.62458
  _Ipro_id_7 |  -.3990997   1.364714    -0.29   0.770    -3.095215    2.297015
  _Ipro_id_8 |  -.7763406   1.312363    -0.59   0.555    -3.369031     1.81635
  _Ipro_id_9 |   1.823674   .9702414     1.88   0.062    -.0931257    3.740473
 _Ipro_id_10 |    .514681   .7736292     0.67   0.507    -1.013693    2.043055
 _Ipro_id_11 |   .5035511   .7843489     0.64   0.522    -1.046001    2.053103
 _Ipro_id_12 |    1.51779   1.283697     1.18   0.239    -1.018271     4.05385
 _Ipro_id_13 |   .7509925   .9703962     0.77   0.440    -1.166113    2.668098
 _Ipro_id_14 |   1.984702   .9897865     2.01   0.047     .0292896    3.940115
 _Ipro_id_15 |   1.498959   .9198305     1.63   0.105    -.3182494    3.316167
 _Ipro_id_16 |   .3668507   1.283663     0.29   0.775    -2.169141    2.902843
 _Ipro_id_17 |  -.0765224   1.518865    -0.05   0.960    -3.077177    2.924133
 _Ipro_id_18 |   .3159201   .8844248     0.36   0.721    -1.431341    2.063181
 _Ipro_id_19 |   .7744181   1.046496     0.74   0.460     -1.29303    2.841866
 _Ipro_id_20 |   5.229265   1.185886     4.41   0.000     2.886441    7.572088
 _Ipro_id_21 |   1.322236   .9578651     1.38   0.169    -.5701135    3.214585
 _Ipro_id_22 |   1.364275   2.076014     0.66   0.512    -2.737078    5.465628
 _Ipro_id_23 |   .6229866   1.173689     0.53   0.596    -1.695742    2.941715
 _Ipro_id_24 |  -.0991551   .9558453    -0.10   0.918    -1.987514    1.789204
 _Ipro_id_25 |   2.910456   1.545858     1.88   0.062     -.143525    5.964438
       _cons |   8.886214   1.147488     7.74   0.000     6.619248    11.15318
------------------------------------------------------------------------------

. 
. predict yhat
(option xb assumed; fitted values)
(5 missing values generated)

. 
. * second stage for Discipline
. 
. xi: reg discipline yhat i.type i.year i.pro_id 
i.type            _Itype_1-4          (naturally coded; _Itype_1 omitted)
i.year            _Iyear_2009-2014    (naturally coded; _Iyear_2009 omitted)
i.pro_id          _Ipro_id_1-25       (naturally coded; _Ipro_id_1 omitted)
note: _Ipro_id_22 omitted because of collinearity

      Source |       SS           df       MS      Number of obs   =       172
-------------+----------------------------------   F(32, 139)      =      2.96
       Model |  486.105015        32  15.1907817   Prob > F        =    0.0000
    Residual |  713.313589       139  5.13175244   R-squared       =    0.4053
-------------+----------------------------------   Adj R-squared   =    0.2684
       Total |   1199.4186       171  7.01414389   Root MSE        =    2.2653

------------------------------------------------------------------------------
  discipline |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        yhat |   1.059356   .5585179     1.90   0.060    -.0449333    2.163645
    _Itype_2 |  -1.286477   1.024405    -1.26   0.211    -3.311908    .7389537
    _Itype_3 |  -1.373071   .7380171    -1.86   0.065    -2.832262    .0861201
    _Itype_4 |  -3.182389   .8014617    -3.97   0.000    -4.767022   -1.597757
 _Iyear_2010 |   2.902143   1.467069     1.98   0.050     .0014866    5.802798
 _Iyear_2011 |   3.448353   1.315399     2.62   0.010     .8475759     6.04913
 _Iyear_2012 |   2.739479   .9483708     2.89   0.004     .8643815    4.614577
 _Iyear_2013 |   2.924909   1.256844     2.33   0.021     .4399057    5.409913
 _Iyear_2014 |   3.364899   1.324473     2.54   0.012     .7461807    5.983617
  _Ipro_id_2 |  -1.057365   1.172512    -0.90   0.369    -3.375631      1.2609
  _Ipro_id_3 |  -2.438573   1.737106    -1.40   0.163     -5.87314    .9959939
  _Ipro_id_4 |  -.2633195   2.002052    -0.13   0.896    -4.221732    3.695093
  _Ipro_id_5 |   -1.33258   1.248711    -1.07   0.288    -3.801504    1.136344
  _Ipro_id_6 |  -1.108163   1.263934    -0.88   0.382    -3.607186     1.39086
  _Ipro_id_7 |   -.490007   1.670573    -0.29   0.770    -3.793027    2.813013
  _Ipro_id_8 |  -2.355489   1.669773    -1.41   0.161    -5.656928    .9459493
  _Ipro_id_9 |  -.2417122   1.210866    -0.20   0.842     -2.63581    2.152386
 _Ipro_id_10 |   .4636869   .9648166     0.48   0.632    -1.443927    2.371301
 _Ipro_id_11 |  -.4890589    1.00325    -0.49   0.627    -2.472663    1.494545
 _Ipro_id_12 |    .216878   2.006893     0.11   0.914    -3.751106    4.184862
 _Ipro_id_13 |   .8781197    1.14749     0.77   0.445    -1.390671     3.14691
 _Ipro_id_14 |  -1.196147    1.64802    -0.73   0.469    -4.454576    2.062282
 _Ipro_id_15 |  -2.249209    1.39932    -1.61   0.110    -5.015912    .5174948
 _Ipro_id_16 |   3.316958    1.80992     1.83   0.069    -.2615761    6.895493
 _Ipro_id_17 |   .0931737   2.491078     0.04   0.970    -4.832131    5.018478
 _Ipro_id_18 |  -.0658142   1.070742    -0.06   0.951    -2.182861    2.051232
 _Ipro_id_19 |  -.2570303    1.39058    -0.18   0.854    -3.006455    2.492394
 _Ipro_id_20 |  -5.667812   3.287912    -1.72   0.087     -12.1686    .8329747
 _Ipro_id_21 |  -1.817399   1.417174    -1.28   0.202    -4.619404    .9846065
 _Ipro_id_22 |          0  (omitted)
 _Ipro_id_23 |  -.9607226   1.343805    -0.71   0.476    -3.617664    1.696218
 _Ipro_id_24 |   .4684444   1.155436     0.41   0.686    -1.816059    2.752948
 _Ipro_id_25 |  -.7815052   2.448416    -0.32   0.750    -5.622459    4.059448
       _cons |  -5.706124   5.924718    -0.96   0.337    -17.42034    6.008098
------------------------------------------------------------------------------

. 
. 
. * second stage for Respond within one month
. xi: probit  chuliwithin yhat  i.type i.year i.pro_id
i.type            _Itype_1-4          (naturally coded; _Itype_1 omitted)
i.year            _Iyear_2009-2014    (naturally coded; _Iyear_2009 omitted)
i.pro_id          _Ipro_id_1-25       (naturally coded; _Ipro_id_1 omitted)

note: _Ipro_id_4 != 0 predicts success perfectly
      _Ipro_id_4 dropped and 3 obs not used

note: _Ipro_id_6 != 0 predicts success perfectly
      _Ipro_id_6 dropped and 5 obs not used

note: _Ipro_id_7 != 0 predicts success perfectly
      _Ipro_id_7 dropped and 1 obs not used

note: _Ipro_id_8 != 0 predicts success perfectly
      _Ipro_id_8 dropped and 3 obs not used

note: _Ipro_id_9 != 0 predicts success perfectly
      _Ipro_id_9 dropped and 10 obs not used

note: _Ipro_id_13 != 0 predicts success perfectly
      _Ipro_id_13 dropped and 7 obs not used

note: _Ipro_id_19 != 0 predicts success perfectly
      _Ipro_id_19 dropped and 3 obs not used

note: _Ipro_id_21 != 0 predicts success perfectly
      _Ipro_id_21 dropped and 3 obs not used

note: _Ipro_id_17 omitted because of collinearity
note: _Ipro_id_22 omitted because of collinearity
Iteration 0:   log likelihood = -62.517818  
Iteration 1:   log likelihood = -40.513076  
Iteration 2:   log likelihood = -39.000984  
Iteration 3:   log likelihood = -38.945966  
Iteration 4:   log likelihood =  -38.94595  
Iteration 5:   log likelihood =  -38.94595  

Probit regression                               Number of obs     =        107
                                                LR chi2(23)       =      47.14
                                                Prob > chi2       =     0.0021
Log likelihood =  -38.94595                     Pseudo R2         =     0.3770

------------------------------------------------------------------------------
 chuliwithin |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        yhat |   1.866615   .6259307     2.98   0.003     .6398132    3.093417
    _Itype_2 |   3.479807   1.174225     2.96   0.003     1.178367    5.781246
    _Itype_3 |   2.908979   .9765846     2.98   0.003     .9949081     4.82305
    _Itype_4 |   3.111749   1.002607     3.10   0.002     1.146675    5.076823
 _Iyear_2010 |   3.203776   1.458373     2.20   0.028     .3454165    6.062135
 _Iyear_2011 |   5.739245   1.763857     3.25   0.001     2.282148    9.196342
 _Iyear_2012 |   1.917659   .8432315     2.27   0.023      .264956    3.570363
 _Iyear_2013 |   3.841264   1.228838     3.13   0.002     1.432786    6.249743
 _Iyear_2014 |   4.088653   1.294509     3.16   0.002     1.551461    6.625845
  _Ipro_id_2 |  -.3276978   .9937132    -0.33   0.742     -2.27534    1.619944
  _Ipro_id_3 |  -2.756847   1.567697    -1.76   0.079    -5.829477    .3157823
  _Ipro_id_4 |          0  (omitted)
  _Ipro_id_5 |  -.6587878   1.051646    -0.63   0.531    -2.719976    1.402401
  _Ipro_id_6 |          0  (omitted)
  _Ipro_id_7 |          0  (omitted)
  _Ipro_id_8 |          0  (omitted)
  _Ipro_id_9 |          0  (omitted)
 _Ipro_id_10 |   1.531365   .8592202     1.78   0.075    -.1526759    3.215406
 _Ipro_id_11 |  -.5297044    .760019    -0.70   0.486    -2.019314    .9599055
 _Ipro_id_12 |  -4.311263   1.741991    -2.47   0.013    -7.725502   -.8970246
 _Ipro_id_13 |          0  (omitted)
 _Ipro_id_14 |  -2.239323    1.56923    -1.43   0.154    -5.314958    .8363122
 _Ipro_id_15 |  -1.977842   1.261708    -1.57   0.117    -4.450743    .4950596
 _Ipro_id_16 |   .3656691   1.072203     0.34   0.733     -1.73581    2.467148
 _Ipro_id_17 |          0  (omitted)
 _Ipro_id_18 |   .5070443    .843929     0.60   0.548    -1.147026    2.161115
 _Ipro_id_19 |          0  (omitted)
 _Ipro_id_20 |   -9.53298   3.708595    -2.57   0.010    -16.80169   -2.264267
 _Ipro_id_21 |          0  (omitted)
 _Ipro_id_22 |          0  (omitted)
 _Ipro_id_23 |  -1.919078   1.266486    -1.52   0.130    -4.401344    .5631882
 _Ipro_id_24 |   .4888443   .8186982     0.60   0.550    -1.115775    2.093463
 _Ipro_id_25 |  -5.643209   2.373772    -2.38   0.017    -10.29572   -.9907005
       _cons |   -21.1846   6.772743    -3.13   0.002    -34.45893   -7.910266
------------------------------------------------------------------------------

. 
. 
. log close
      name:  <unnamed>
       log:  C:\Users\yiranli\Dropbox\A&A\Stata14\03_analysis.log
  log type:  text
 closed on:  11 Jan 2023, 10:44:27
--------------------------------------------------------------------------------
